package cn.ricecode.restructure.java8;


import org.apache.commons.lang3.StringUtils;

import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * @author LiuZhulan
 */
public class MyStream {

    public static void main(String[] args) {
        CartService cartService=new CartService();
        List<Sku> cartSkuList = cartService.getCartSkuList();

        Map<String,Long> collect = cartSkuList.stream()
                .map(Sku::getName)
                .filter(StringUtils::isNoneBlank)
                .collect(Collectors.groupingBy(Function.identity(),Collectors.counting()));


        Integer integer=0;
        System.out.println(cartSkuList);

    }
}
